<%-- 
    Document   : ecGestionPatrocinador
    Created on : 01/11/2009, 10:56:55 PM
    Author     : Liz Alvarez
--%>
<%@page contentType="text/html" pageEncoding="UTF-8" isELIgnored="true" import="java.util.List"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>.::Incubadora de Empresas::. Invierta con nosotros</title>
        
        <%@ page 
            
            import="pe.edu.unmsm.fisi.ceiecbt.ejb.beans.ComtbPatrocinadorFacade"
            import="pe.edu.unmsm.fisi.ceiecbt.ejb.beans.ComtbPatrocinadorFacadeRemote"
            import ="pe.edu.unmsm.fisi.ceiecbt.ejb.entidad.ComtbEmpresa"
            import ="pe.edu.unmsm.fisi.ceiecbt.ejb.entidad.ComtbIndicadores"
            
            import ="pe.edu.unmsm.fisi.ceiecbt.app.clases.Menu"
            import="java.util.*" 
            import="javax.naming.*" 
            import="javax.rmi.PortableRemoteObject"
            import="javax.ejb.*"
            import= "javax.ejb.EJB"
            
            
            %>
        
        <%@include file="jspf/links.jspf"%>
        
        <style type="text/css">
            #s5_mainbackmiddle {
                width:950px;}
            
            #s5_topback {
                width:926px;}
            
            #s5_bottomtop {
                width:926px;}
            
            #s5_bottommiddle {
                width:926px;}
            
            #s5_maininner {
                width:904px;}
            
            #s5_footer {
                width:950px;}
            
            #s5_topleftbottom {
                width:926px;}
            
            #s5_mainbody {
                width:632px;}
            
        </style>  
        
    </head>
    <body>
        <div id="s5_background"> 
            <div id="s5_topbackground"> 
                
                <div id="s5_topback"> 
                    <div id="s5_topleft">
                        <div class="s5_topblock">
                            <div id="s5_logo" style="cursor:pointer;">
                                <embed height="76" width="312" flashvars="width=252&amp;height=118&amp;wmode=transparent" wmode="transparent" allowfullscreen="true" quality="high" name="mediaplayer" id="mediaplayer" style="" src="<%=request.getContextPath()%>/flash/banner.swf" type="application/x-shockwave-flash" /> 
                            </div>
                        </div>	
                        
                    </div>
                    
                    <div id="s5_topright">
                        <div class="s5_topblock">
                            <div id="s5_search">
                                <div style="position:relative;">
                                    <div class="moduletable">
                                        
                                        <form action="" method="get">
                                            <div class="search">
                                            <input name="searchword" id="mod_search_searchword" maxlength="20" alt="search" class="inputbox" type="text" size="20" value="Buscar..."  onblur="if(this.value=='') this.value='Buscar...';" onfocus="if(this.value=='Buscar...') this.value='';" />	</div>
                                            
                                            <input type="hidden" name="option" value="com_search" />
                                            <input type="hidden" name="Itemid" value="5" />	
                                    </form>		</div>
                                </div>
                            </div>
                        </div>	
                    </div>
                </div>
                
                <%@include file="jspf/menu_uhead.jspf"%>
                
                <%


            HttpSession sesion_act = request.getSession(true);

            String usr = (String) sesion_act.getAttribute("user");

            if (usr != null) {
                // request.setAttribute(usr);

                %>
                <div id="s5_s5boxtab" onclick="">
                    <div id="s5_s5boxleft"></div>
                    <div id="s5_s5boxmiddle">
                <a href="CerrarSesion">Cerrar Sesión</a>							</div>							</div>
                <div id="s5_s5boxright"></div>						
            </div>
            
            <%                } else {

            %>
            
            <div id="s5_s5boxtab" onclick="">
                <div id="s5_s5boxleft"></div>
                <div id="s5_s5boxmiddle">
                Iniciar Sesión							</div>
                <div id="s5_s5boxright"></div>						
            </div>
            
            <%            }

            %>
            
            
            
            
        </div>
        
        <div class="clear:both;"></div>
        
        <div id="s5_topbackbottombar"></div>
        
        
        
        <div id="s5_mainbodywrapper">		
            <div id="s5_mainbackmiddle">	
                <div id="s5_maininnerleft"></div>	
                <div id="s5_maininner">
                    
                    
                    <%@include file="jspf/menu_aright.jspf"%>
                    
                    <div style="margin-right:252px;">
                        
                        <div id="s5_maincolumn" style="width:650px;">
                            
                            
                            
                            <div id="s5_leftmainwrap">
                                <div id="s5_maincolumn_top">
                                    <div id="s5_maincolumn_top_left"></div>
                                    <div id="s5_maincolumn_top_right"></div>
                                </div>
                                <div id="s5_maincolumn_wrap">
                                    
                                    <div id="s5_positions">
                                        
                                        <div id="s5_user1_100">
                                            <div class="module">
                                                <div>
                                                    <div>
                                                        
                                                        
                                                        
                                                        
                                                        <table border="0" style="width: 100%;">
                                                            <tbody>
                                                                
                                                                <%

            List<ComtbEmpresa> listpat = (List) request.getAttribute("ObjEmpresa");
            //int cont=listpat.size();
            List<ComtbIndicadores> listind = (List) request.getAttribute("ObjIndicador");

                                                                %>
                                                                
                                                                <tr>
                                                                    <td valign="top" style="text-align: center;" rowspan="5" width="280px;"><br/>
                                                                        <p style="margin:5px;">
                                                                            <a href="#">
                                                                                
                                                                                <img style="height:52px;width:160px;" border="0" src="imagenes/acklis.gif"/>
                                                                            </a><br/>
                                                                        </p>
                                                                        
                                                                    </td>
                                                                    <%

            String var1 = listpat.get(0).getEmprevRazSocial().toString();
            //String var1=listpat.get(0).getRubenvCodRubro().getRubenvDescripcion();
%>
                                                                    
                                                                    <td colspan="2" rowspan="1">
                                                                        <h1><%=var1%></h1>
                                                                    </td>
                                                                    
                                                                </tr>
                                                                
                                                                <tr>
                                                                    <td colspan="2" rowspan="1">
                                                                        
                                                                    </td>
                                                                </tr>
                                                                
                                                                <tr>
                                                                    <td>
                                                                        <table>
                                                                            <tbody>
                                                                                
                                                                                <tr>
                                                                                    <!--<td valign="top" align="left" width="33%">
          <strong>Price: </strong><span style="font-weight: bold;">
$269.54</span>
 (including 8.25 % tax)<br/>
 
 </td>-->
 
                                                                                    <td valign="top" align="left" width="33%">
                                                                                        <strong>Descripcion</strong>
                                                                                        
                                                                                    </td>
                                                                                    
                                                                                    <td>
                                                                                        <strong>:</strong>
                                                                                        
                                                                                    </td>
                                                                                    
                                                                                    <td width="180px;">
                                                                                        
                                                                                        <p style="margin:5px;" >
                                                                                            <%=listpat.get(0).getEmprevDescripcion().toString()%>
                                                                                        </p>
                                                                                        
                                                                                    </td>
                                                                                    
                                                                                    <td valign="top"><br/></td>
                                                                                </tr>
                                                                                
                                                                                <tr>
                                                                                    <td width="80px;">
                                                                                        
                                                                                        <strong>Monto</strong>
                                                                                        
                                                                                    </td>
                                                                                    
                                                                                    <td>
                                                                                        <p>
                                                                                            <strong>:</strong>
                                                                                            
                                                                                        </p>
                                                                                    </td>
                                                                                    
                                                                                    <td>        
                                                                                        <p style="margin:5px;">
                                                                                            <%="S/. " + listpat.get(0).getEmprerMonto()%>
                                                                                        </p>
                                                                                    </td>
                                                                                    
                                                                                    <td valign="top"><br/></td>
                                                                                </tr>
                                                                                
                                                                                <tr>
                                                                                    
                                                                                    <td>
                                                                                        <strong>Producto</strong>
                                                                                        
                                                                                    </td>
                                                                                    
                                                                                    <td>
                                                                                        <p>
                                                                                            <strong>:</strong>
                                                                                            
                                                                                        </p>
                                                                                    </td>
                                                                                    
                                                                                    
                                                                                    <td>
                                                                                        <p style="margin:5px;">
                                                                                            <%=listpat.get(0).getEmprevProducto().toString()%>
                                                                                        </p>
                                                                                    </td>
                                                                                    
                                                                                    <td valign="top"><br/></td>
                                                                                </tr>
                                                                                
                                                                                <tr>
                                                                                    <td>
                                                                                        <strong>Tipo de Empresa</strong>
                                                                                        
                                                                                    </td>
                                                                                    
                                                                                    <td>
                                                                                        <p>
                                                                                            <strong>:</strong>
                                                                                            
                                                                                        </p>
                                                                                    </td>
                                                                                    
                                                                                    
                                                                                    <td>
                                                                                        <p style="margin:5px;">
                                                                                            <%=listpat.get(0).getRubenvCodRubro().getRubenvDescripcion().toString()%>
                                                                                        </p>
                                                                                    </td>
                                                                                    
                                                                                    <td valign="top"><br/></td>
                                                                                </tr>
                                                                                
                                                                                <tr>
                                                                                    
                                                                                    <td>
                                                                                        <strong>Estado de Empresa</strong>
                                                                                        
                                                                                    </td>
                                                                                    
                                                                                    <td>
                                                                                        <p>
                                                                                            <strong>:</strong>
                                                                                            
                                                                                        </p>
                                                                                    </td>
                                                                                    
                                                                                    
                                                                                    <td>
                                                                                        <%
            int var23 = listpat.get(0).getEmpreiEstado();
            String tipoemp;
            if (var23 == 1) {
                tipoemp = "Pre-Incubada";
            } else {
                tipoemp = "Incubada";
            }

                                                                                        %>
                                                                                        <p style="margin:5px;"><%=tipoemp%></p>
                                                                                    </td>
                                                                                    
                                                                                    <td valign="top"><br/></td>
                                                                                </tr>
                                                                                
                                                                                <%
            if (listind != null) {
                if (listind.size() > 0) {
                    String valor1 = "" + listind.get(0).getIndicvValor();
                                                                                %>
                                                                                
                                                                                <tr>
                                                                                    
                                                                                    <td>
                                                                                        <strong><%=listind.get(0).getComtbTipoIndicador().getTipinvDescripcion()%></strong>
                                                                                        
                                                                                    </td>
                                                                                    
                                                                                    <td>
                                                                                        <p>
                                                                                            <strong>:</strong>
                                                                                            
                                                                                        </p>
                                                                                    </td>
                                                                                    
                                                                                    
                                                                                    <td>
                                                                                        <p style="margin:5px;">
                                                                                            <%=valor1 + "%"%>
                                                                                        </p>
                                                                                    </td>
                                                                                    
                                                                                    <td valign="top"><br/></td>
                                                                                </tr>
                                                                                
                                                                                <%

                                                                                        if (listind.size() > 2) {

                                                                                            String valor2 = "" + listind.get(1).getIndicvValor();

                                                                                            String valor3 = "" + listind.get(2).getIndicvValor();

                                                                                            String val3 = valor3.substring(0, valor3.indexOf("."));

                                                                                %>
                                                                                
                                                                                <tr>
                                                                                    
                                                                                    <td>
                                                                                        <strong><%=listind.get(2).getComtbTipoIndicador().getTipinvDescripcion()%></strong>
                                                                                        
                                                                                    </td>
                                                                                    
                                                                                    <td>
                                                                                        <p>
                                                                                            <strong>:</strong>
                                                                                            
                                                                                        </p>
                                                                                    </td>
                                                                                    
                                                                                    
                                                                                    <td>
                                                                                        <p style="margin:5px;">
                                                                                            <%=val3%>
                                                                                        </p>
                                                                                    </td>
                                                                                    
                                                                                    <td valign="top"><br/></td>
                                                                                </tr>
                                                                                
                                                                                <tr>
                                                                                    
                                                                                    <td>
                                                                                        <strong><%=listind.get(1).getComtbTipoIndicador().getTipinvDescripcion()%></strong>
                                                                                        
                                                                                    </td>
                                                                                    
                                                                                    <td>
                                                                                        <p>
                                                                                            <strong>:</strong>
                                                                                            
                                                                                        </p>
                                                                                    </td>
                                                                                    
                                                                                    
                                                                                    <td>
                                                                                        <p style="margin:5px;">
                                                                                            <%="S/. " + valor2%>
                                                                                        </p>
                                                                                    </td>
                                                                                    
                                                                                    <td valign="top"><br/></td>
                                                                                </tr>
                                                                                
                                                                                <%
                                                                                        }

                                                                                %>
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                <%
                }
            }
                                                                                %>
                                                                                
                                                                            </tbody>
                                                                            
                                                                            
                                                                        </table>
                                                                        
                                                                    </td>
                                                                </tr>
                                                                
                                                                <%
            if (listind != null && listind.size() > 0) {

                                                                %>
                                                                <tr>
                                                                    <td><div style="text-decoration: underline; font-weight: bold;">Disponible</div>
                                                                        <br/>
                                                                        <span style="font-weight: bold;"># Inversiones actuales: </span>
                                                                        <br/><br/>
                                                                    0<br/></td>
                                                                    <td colspan="1"><br/><div>
                                                                            <form id="addtoPort" name="addtoPort" method="post" action="Inversion">
                                                                                <input type="hidden" value="<%=listpat.get(0).getEmprevCodEmpresa()%>" name="IdEmpresa"/>
                                                                                <div>
                                                                                    <label for="lblPatrocinio">Tipo Patrocinio</label>:
                                                                                </div>
                                                                                
                                                                                <script type="text/javascript">


                                                                                    function mostrar(div) {
                                                                                        div1 = document.getElementById("divAcc"); 
                                                                                        div2 = document.getElementById("divInv");
                                                                                        switch(div)
                                                                                        {
                                                                                            case "1":
      
                                                                                                div1.style.display = "block";
                                                                                                div2.style.display = "none";
   
                                                                                                break;
                                                                                            case "2":
      
                                                                                                div1.style.display = "none";
                                                                                                div2.style.display = "block";
   
                                                                                                break;

                                                                                        }
                                                                                    }
                                                                            
    
    
                                                                                </script>
                                                                                
                                                                                <div>
                                                                              
                                                                                    
                                                                                    <select name="IdTipoPatrocinador" id="IdTipoPatrocinador" class="inputbox" onchange="mostrar(this.value)">
                                                                                        <option value="1">Accionista</option>
                                                                                        <option value="2">Inversionista</option>
                                                                                    </select>
                                                                          
                                                                                </div>
                                                                                
                                                                                
                                                                                <br/>
                                                                                
                                                                                <div id="divInv"  style="display: none;">
                                                                                    <div>
                                                                                        <br/>
                                                                                        <label for="lblPerfil">Perfil</label>:
                                                                                    </div>
                                                                                    <div>
                                                                                        <select name="IdPerfil" id="IdPerfil" class="inputbox">
                                                                                            <option value="1">Perfil 1</option>
                                                                                            <option value="2">Perfil 2</option>
                                                                                            <option value="3">Perfil 3</option>
                                                                                        </select>
                                                                                    </div>
                                                                                    <br/>
                                                                                    <br style="clear: both;"/>
                                                                                    <br/>
                                                                                    <div>
                                                                                        <label for="Color_field">Monto</label>: (S/.)
                                                                                    </div>
                                                                                    
                                                                                    <div>
                                                                                        <input type="text" style="vertical-align: middle;" name="ValMonto" id="ValMonto" size="4" class="inputbox"/> 
                                                                                    </div>
                                                                                    
                                                                                </div>
                                                                                <br/>
                                                                                
                                                                                
                                                                                <div id="divAcc" style="display: none;">
                                                                                    
                                                                                    <div>
                                                                                        <br/>
                                                                                           <%
                                                                                         if (listind.size() > 2) {
                                                                                        %>
                                                                                        <label for="Color_field">Acciones</label>:
                                                                                    </div>
                                                                                    
                                                                                    <div>
                                                                                     
                                                                                        <select name="numAcc" id="numAcc" class="inputbox">
                                                                                            <%

                                                                    String val = "" + listind.get(2).getIndicvValor();
                                                                    int cont = Integer.parseInt(val.substring(0, val.indexOf(".")));

                                                                    for (int i = 1; i < cont + 1; i++) {

                                                                                            %>
                                                                                            
                                                                                            <option value="<%=i%>"><%=i%></option>
                                                                                            
                                                                                            <%
                                                                    }
 
                                                                                            %>
                                                                                            
                                                                                           
                                                                                        </select>
                                                                                         
                                                                                        <input type="hidden" value="<%=listind.get(1).getIndicvValor()%>" name="valAcc" id="valAcc" />
                                                                                        <%
                                                                                        }
                                                                                        %>
                                                                                    </div>
                                                                                    <br/>
                                                                                    <br/>
                                                                                    
                                                                                </div>
                                                                                <br/>
                                                                                <input type="hidden" value="1" name="anadir" id="anadir" />
                                                                                
                                                                               
                                                                                
                                                                                <input type="submit" title="Añadir al portafolio" value="Añadir al portafolio" style="border: medium none ; background: transparent url(imagenes/add-to-cart_orange.gif) no-repeat scroll left center; text-align: center; width: 160px; height: 35px; cursor: pointer; font-weight: bold; font-family: inherit; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; vertical-align: middle;"/>
                                                                                
                                                                            </form>
                                                                        </div>
                                                                        
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td colspan="3"/>
                                                                </tr>
                                                                <tr>
                                                                    <td colspan="3"><hr/><h4>Nota:</h4>La informacion de los perfiles de inversión esta disponible <a>aqui</a><br/>Revisar ello para poder elegir el perfil apropiado.</td>
                                                                </tr>
                                                                <tr>
                                                                    <td colspan="3"><br/></td>
                                                                </tr>
                                                                <tr>
                                                                    <td colspan="3"><br/></td>
                                                                </tr>
                                                                <%
            }
                                                                %>
                                                            </tbody>
                                                        </table>
                                                        
                                                        
                                                        
                                                        <a href="login.jsp?idemp=<%=listpat.get(0).getEmprevCodEmpresa().toString()%>" style="margin-left:300px;">>> Ver mas detalle</a>
                                                        <a href="Inicio" style="margin-left:300px;">>> Volver</a>   
                                                        
                                                        
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <div style="clear:both;"></div>
                                    <div id="s5_mainbody">
                                        
                                        <table width="100%" cellspacing="0" cellpadding="0">  
                                            <tr>
                                                <td class="componentheading" colspan="4"></td>
                                            </tr>
                                            
                                        </table>
                                        
                                    </div>
                                    
                                </div>
                                <div id="s5_maincolumn_bottom">
                                    <div id="s5_maincolumn_bottom_left"></div>
                                    <div id="s5_maincolumn_bottom_right"></div>
                                </div>
                            </div>	
                            
                            
                        </div>
                        
                        <div style="float:left;height:19px;width:100%;"></div>
                        
                        <div id="s5_bottomwrap">
                            
                            
                            <div id="s5_user7_100">
                                <div id="s5_user789_left">
                                    <div class="module">
                                        <div>
                                            <div>
                                                <div>
                                                Ninguna informacion aun...</div>
                                            </div>
                                        </div>
                                    </div>
                                    
                                </div>
                            </div>
                        </div>
                        
                    </div>
                    
                    <div style="clear:both;"></div>
                    
                    
                </div>
                
                <div id="s5_maininnerright"></div>		
                
                
            </div>
            
            
            <%@include file="jspf/afooter.jspf"%>
        </div>
        
    </body>
    
</html>
